package view;

import javax.swing.*;
import logic.*;

/**
 * this is the general class for a view.
 * @author Vossen en Konijnen group 2
 *
 */
public abstract class AbstractView extends JPanel {
	
	private Simulator simulator;

	/**
	 * makes a new AbstractView. 
	 * Also add's the view to the list of views.
	 * @param simulator
	 */
	public AbstractView(Simulator simulator) {
		this.simulator=simulator;
		simulator.addView(this);
	}
	
	/** 
	 * gives the current simulator
	 * @return the current simulator
	 */
	public Simulator getModel() {
		return simulator;
	}
	
	/**
	 * when the model is changed repaint the views to the new numbers
	 */
	public void updateView() {
		repaint();
	}

}